Replace Text
AutomatR.Word.Activities.ReplaceText
The "Replace Text" activity in AutomatR is part of the Word activities package, allowing you to replace all instances of specific text in a Word document with another specified text. This activity is designed to facilitate dynamic text replacement during automation workflows.
Properties
Name | Description |
---|---|
Input | |
Search For | Specifies the text to be searched for and replaced. String variables containing the text to search for. |
Replace With | Specifies the text to replace the searched text. String variables containing the replacement text. |
Replace All | If checked, replaces all occurrences of the searched text with the replacement text. Boolean variables containing the flag for replacing all occurrences. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. Enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Replace Text" activity. Useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
How to use:
- Drag and drop the "Replace Text" activity onto the workflow.
- Configure the properties by specifying the text to search for, the replacement text, and whether to replace all occurrences.
- Optionally, configure the delay before executing the activity.
- Execute the workflow to replace the specified text in the Word document.
Example:
Consider an example where the "Replace Text" activity is used to replace the occurrences of the text "OldCompanyName" with "NewCompanyName" in a Word document:
Replace Text:
Search For: "OldCompanyName"
Replace With: "NewCompanyName"
Replace All: true
In this example, the activity searches for all occurrences of "OldCompanyName" in the Word document and replaces them with "NewCompanyName". The "Replace All" option is set to true
to replace all occurrences.